/**
 * 枚举工具类
 */
export  const EnumUtils = {


  /**
   * 将枚举转为对象数组
   * @param enumObj 枚举对象
   * @returns 转换后的对象数组
   */
  enumToArray<T>(enumObj: T): { name: string; value: number }[] {
    return Object.keys(enumObj)
      .filter((key) => isNaN(Number(key))) // 过滤掉反向映射的数字键
      .map((key) => ({ name: key, value: enumObj[key as keyof T] as unknown as number }));
  }

}


